package com.my.auth;

import com.my.auth.listener.BcloudListener;
import com.my.auth.security.annotation.EnableBcloudAuthorizationServer;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * @author zhaodongchao
 * @date 2020/3/21 16:56
 **/
@EnableBcloudAuthorizationServer
@SpringBootApplication
public class BcloudAuthServerApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(BcloudAuthServerApplication.class);
        //关闭Banner
        springApplication.setBannerMode(Banner.Mode.OFF);
        //设置自定义监听器
        springApplication.addListeners(new BcloudListener());
        //添加自定义的应用初始化器
        springApplication.addInitializers();
        //启动应用
        springApplication.run(args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(BcloudAuthServerApplication.class);
    }
}
